package com.zzc.legou.auth.client;

import com.zzc.legou.security.api.api.UserApi;
import com.zzc.legou.security.api.po.Role;
import com.zzc.legou.security.api.po.User;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

@FeignClient(name = "security-service", fallback = UserClient.UserClientFallback.class)
public interface UserClient extends UserApi {

    @Component
    @RequestMapping("/user-fallback")
    class UserClientFallback implements UserClient {
        @Override
        public User getByUserName(String userName) {
            return null;
        }

        @Override
        public List<Role> selectRolesByUserId(Long id) {
            return null;
        }
    }
}
